package com.yan;

public class QueueConstants {

    /*空字符串*/
    public static final String empty = "";


    /*交换器名称*/
    public static final String exchangeName = "ex.routing.exchange.yan";

    /*队列名称*/
    public static final String queueName = "queue.name.yan.";

    /*日志级别*/
    public enum LogLevel {
        ERROR(0, "ERROR"),
        INFO(1, "INFO"),
        WARN(2, "WARN"),
        ;
        private int index;
        private String level;

        public static String forIndex(int index) {
            for (LogLevel value : LogLevel.values()) {
                if (value.getIndex() == index) {
                    return value.getLevel();
                }
            }
            return empty;
        }

        LogLevel(int index, String level) {
            this.index = index;
            this.level = level;
        }

        public int getIndex() {
            return index;
        }

        public String getLevel() {
            return level;
        }
    }
}
